package es.uem.listaactividades;

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.drawable.AnimationDrawable;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

public class Animation extends Activity {

    AnimationDrawable animacion;
    @Override public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          animacion = (AnimationDrawable)getResources().getDrawable(R.drawable.animacion);
          ImageView vista = new ImageView(this);
          vista.setBackgroundColor(Color.WHITE);
          vista.setImageDrawable(animacion);
          vista.setOnClickListener(new OnClickListener() {
                 public void onClick(View view) {
                        animacion.start();
                 }
          });
          setContentView(vista);
    }
}


